From: Jasper St. Pierre Date: Thu, 12 Dec 2013 19:42:41 +0000 (-0500) Subject: background: Don't prematurely remove file monitors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2984 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=01f740ce69017f6305dd579c2eab55f0076ca6f6;p=gnome-shell.git background: Don't prematurely remove file monitors We need to only remove file monitors when there's no other users of the content... --- diff --git a/js/ui/background.js b/js/ui/background.js index a56a0af8b..20a3a4030 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -125,7 +125,8 @@ const BackgroundCache = new Lang.Class({ removeImageContent: function(content) { let filename = content.get_filename(); - if (filename && this._fileMonitors[filename]) + let hasOtherUsers = this._images.some(function(content) { return filename == content.get_filename(); }); + if (!hasOtherUsers) delete this._fileMonitors[filename]; this._removeContent(this._images, content);